package com.demo.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.demo.user.entity.User;
import com.demo.user.mapper.UserMapper;
import com.demo.user.service.UserService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author YT
 * @date 2019-05-16
 */
@Service
@AllArgsConstructor
@Transactional(readOnly = true, rollbackFor = Exception.class)
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    @Transactional(readOnly = false, rollbackFor = Exception.class)
    @LcnTransaction
    public void insertUserServiceName(User user) {
        baseMapper.insert(user);
    }
}
